package com.nbsaas.boot.common.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.code.annotation.data.Dict;
import com.nbsaas.boot.code.annotation.data.DictItem;
import com.nbsaas.boot.code.annotation.data.DictKey;
import com.nbsaas.boot.jpa.data.entity.LongEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Comment;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;


@ComposeView
@org.hibernate.annotations.Table(appliesTo = "bs_data_type", comment = "数据类型")
@EqualsAndHashCode
@Data
@FormAnnotation(model = "数据类型")
@Entity
@Table(name = "bs_data_type")
public class DataType extends LongEntity {

    @SearchItem(label = "类型名称", name = "name")
    @Comment("类型名称")
    @FormField(title = "类型名称", sortNum = "1", grid = true, width = "200")
    @Column(length = 30)
    private String name;


    @DictKey("dataType")
    @FormField(title = "数据类型", sortNum = "1", grid = true, col = 12,type = InputType.dictionary)
    @Comment("数据类型")
    @Dict(
            items = {
                    @DictItem(value = 1, label = "系统"),
                    @DictItem(value = 2, label = "自定义")
            }
    )
    private Integer type;


    @Comment("java路径")
    @FormField(title = "java路径", sortNum = "1", grid = true, width = "200")
    private String path;
}
